package com.cskaoyan.javase.oop2._1extends._7initialization._1classload;

/**
 * 类加载可以连环触发,要从顶层父类开始进行类加载
 * 扩展:
 *      Object,String这种jdk源码中的类,也是需要类加载的,
 *          只不过类加载的类加载器不同
 *
 * @since 16:08
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo extends B {
    public static void main(String[] args) {
        System.out.println(B.num);
        // new B();
    }
}

class A {
    static int num;

    static {
        System.out.println("A");
    }
}

class B extends A {
    static {
        System.out.println("B");
    }
}